<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="UTF-8"%>
<%@taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<%@ taglib uri = "http://java.sun.com/jsp/jstl/core" prefix = "c"%>
<%@ taglib prefix="di" uri="http://displaytag.sf.net"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Accomodations</title>
</head>
<body>

<%
String ctx = request.getContextPath()+"/accomodation/saveaccomodation";
String editctx = request.getContextPath()+"/accomodation/editaccomodation";
%>


	<form:form id="accomodationForm" method="POST" modelAttribute="accomodationdata" action="<%=ctx %>">
		<table align="center">

			<tr>
				<td>Name</td>
				<td>City</td>
				<td>Location</td>
			</tr>
			<tr>
				<td><form:hidden path="id"/> 
				<form:input path="name" size="15" /></td>
                <td><form:select path="accomdCity.cityId">
                
              
 <form:options items="${cities}" itemLabel="cityName" itemValue="cityId"/>
                </form:select></td>
				<td><form:input path="location" size="15" /></td>
				
			</tr>
		</table>
		<input type="submit" value="Save accomodation" />
	</form:form>
	
	
				<di:table  name="${allAccomodations}" requestURI=""  pagesize="10"  uid="t"  export="true" decorator="com.onlinemathuracrud.displaydecorator.AccomodationDecorator">
				<di:caption>Showing List of All Accomodations</di:caption>
				<di:column title="S.No.">${t_rowNum}</di:column>
				<di:column property="name" title="accomodation Name" />
				<di:column property="accomdCity.cityName" title="accomodation City" />
				<di:column property="location" title="accomodation Location"/>
				
		      	<di:column property="editUrl" title="Edit accomodation"/>
				<di:column property="deleteUrl" title="Delete accomodation"/>
				
				<di:setProperty name="paging.banner.placement" value="bottom" />
				<di:setProperty name="export.pdf" value="true" />
				<di:setProperty name="export.xml" value="true" />
				</di:table>
	
	
	
</body>
</html>